package com.example.demo.dao;

import com.example.demo.entity.Student;
import com.example.demo.reponsitroy.StuReponsitory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Created by 13795 on 2017/7/5.
 */
@Component
public class StuDao {
    @Autowired
    private StuReponsitory stuReponsitory;

    public List<Student> findAllStudent(){
        List<Student> list=stuReponsitory.findAll();
        return list;
    }

    public void save(Student student) {
        stuReponsitory.save(student);
    }

    public void deleteStudent(Integer id) {
        stuReponsitory.delete(id);
    }
}
